<template>
	<view class="xb-page">
		<view class="xb-page-container">
			<form @submit="addorg">
				<view>
					<pageHead :title="title"></pageHead>
					<view class="xb-form-cell">
						<input v-model="formdata.descs" class="xb-input" placeholder-class="xb-input-placeholder" maxlength="10"
						 placeholder="机构名称" />
					</view>
					<view class="xb-form-cell">
						<input v-model="formdata.tel" class="xb-input" placeholder-class="xb-input-placeholder" maxlength="10"
						 placeholder="机构练习方式" />
					</view>

					<view class="xb-form-cell">
						<input v-model="formdata.address" class="xb-input" placeholder-class="xb-input-placeholder" maxlength="10"
						 placeholder="机构详细地址" />
					</view>
					<view class="xb-button-cell">
						<button form-type="submit" class="xb-button page-button" size="mini" plain="true" type="primary">完成</button>
					</view>
				</view>
			</form>
		</view>
	</view>
</template>

<script>
	import pageHead from '../../../components/page-head.vue';
	export default {
		data: {
			title: '添加机构',
			formdata: {
				descs: '',
				tel: '',
				address: '',
			}

		},
		methods: {
			addorg: async function() {
			
				uni.showNavigationBarLoading();
				const res = await addorg(formData);
				if (res.success == true) {
					uni.showToast({
						title:"添加成功"
					})
					uni.navigateBack({
						delta:1
					})
				} else {
					uni.showToast({
						title:"添加失败"
					})
				}

			},
			chooseimage: function() {
				uni.choolseImage({
					success: function(imagespath) {
						const temppath = imagespath.tempFilePaths;
						uni.uploadFile({
							url: '',
							filePath: temppath[0],
							name: '',
							formData: {
								name: '',
								tel: '',
								address: '',

							},
							success: function(updatefiles) {

							}
						})
					}
				})

			}

		},
		components: {
			pageHead
		}

	}
</script>

<style scoped>
	@import "../../../common/uni.css";
	@import "../../../common/xb.css";

	.icon-upload-icon {
		width: 100px;
		height: 100px;
	}
	.xb-button-cell {
		margin-top: 20px;
		width: 100%;
	}
	.page-button {
		position: absolute;
		left: 0%;
		width: 100%;
	}

	.input-section-view {
		margin-left: 40px;
		margin-right: 40px;
		margin-bottom: 20px;
	}

	.input-style {
		font-size: 30px;
		color: #DDDDDD;
	}

	.placeholder-class {
		font-size: 30px;
		color: #DDDDDD;

	}


	.class_bottom_input_line {
		border-color: #DDDDDD;
		border-style: solid;
		border-top-width: 0px;
		border-right-width: 0px;
		border-left-width: 0px;
		border-bottom-width: 1px;
	}

	.org-btn {
		border-radius: 0px;
		font-size: 35px;
		height: 80px;
		width: 80%;
	}
</style>
